<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
    <h:head>
        <title>Twitterer Overview</title>
    </h:head>
    <h:body>
        <h:form>
            <p:messages id="messages" globalOnly="true" />  
            <p:dataTable value="#{twittererOverViewBean.twitterers}" var="twitterer" id="table" style="width: 600px">
                 <f:facet name="header">  
                    List of Twitterers
                </f:facet>
                <p:column>
                    <f:facet name="header">UserName</f:facet>
                        #{twitterer.userName}
                </p:column>
                <p:column>
                    <f:facet name="header">Read</f:facet>
                    <p:commandButton value="Read" action="#{twittererOverViewBean.readMessages(twitterer)}" immediate="true"/> 
                </p:column>
                <p:column>
                    <f:facet name="header">Add to favorites</f:facet>
                    <p:commandButton value="Add" action="#{twittererOverViewBean.addFavorite(twitterer)}"/> 
                </p:column>
                 <f:facet name="footer">  
                     In total there are #{twittererOverViewBean.twitterers.size()} twitterers. 
                </f:facet>
            </p:dataTable>
            <p:commandButton value="Home"  action="#{twittererOverViewBean.toHome()}" immediate="true"/>
        </h:form>
    </h:body> 
</html>
